package com.dz.scrm.mvp.model.service

import com.dz.scrm.mvp.model.api.HEADER_API_VERSION
import com.dz.scrm.mvp.model.entity.*
import io.reactivex.Observable
import retrofit2.http.*

/**
 * 作者：fanda
 * 日期：2021/4/21 18:58
 * 描述：请求接口服务
 */
interface UserService {

    //验证码
    @POST("api/dz-app/work-phone/sms/code")
    fun getCode(@Query("username") lastIdQueried: String): Observable<BaseResponse<MsgCodeBean?>>

    //登录
    @GET("api/dz-app/work-phone/oauth/tenant")
    fun Login(@Query("username") lastIdQueried: String, @Query("code") code: String):
            Observable<BaseResponse<LoginBean?>>

    //获取企业
    @POST("api/dz-app/work-phone/oauth/verify")
    fun checkCompany(@Query("username") username: String
                     , @Query("tenantId") tenantId: String
                     , @Query("verify") verify: String
                     , @Query("registrationId") registrationId: String):
            Observable<BaseResponse<CompanyInfoBean?>>

    /*检测更新*/
    @GET("api/dz-app/work-phone/version/check")
    fun checkVersion(): Observable<BaseResponse<CheckVersionBean?>>

    // 通话记录上传
    @POST("api/dz-app/work-phone/call-record/submit")
    fun postPhoneRecord(@Body body: PhoneRecordParams): Observable<BaseResponse<DZResponse?>>

    //获取拨打电话的名字
    @GET("api/dz-app/work-phone/customer/get")
    fun GetUerPhoneName(@Query("customerPhone") lastIdQueried: String):
            Observable<BaseResponse<LoginCompanyBean?>>
}